package repository

import (
	"golang-websocket-chatroom/global"
	"golang-websocket-chatroom/model"
)

func Login(name string) (user model.User, err error) {
	err = global.DB.Where("name = ?", name).Find(&user).Error
	if err != nil {
		return model.User{}, err
	}
	return user, nil
}
